<?php
    
 	 $arrayid=$_POST['arrayid'];
     $sid=$_POST['sid'];
	 $gid=$_POST['gid'];
	 
	 $connect=mysql_connect("localhost","root","192510");
	 mysql_select_db("news",$connect);
	
	 if(isset($arrayid[0])){
		 foreach ($arrayid as $sid){
          $sql="insert ignore into guanxi(sid,gid) value($sid,$gid)";
		  mysql_query($sql);
	   }
     }
	 
    if(isset($sid)){
	   if(isset($gid)){
		  $sql="insert ignore into guanxi(sid,gid) value($sid,$gid)";
		  mysql_query($sql);
	   }
	}
	
?>